<html>
<script>
this.globalVar = {
    myGlobalVarsMethod: function (){
        // Implementation
    }
};
console.log(this.globalVar); /*
 { myGlobalVarsMethod: [Function] }
 Object myGlobalVarsMethod : ()
	__proto__: Object
*/
this.globalVariable = 'globalVariable';
function globalFunction (){
    this.innerVariable = 'innerVariable';
    console.log(this.globalVariable === undefined); // false
    console.log(this.innerVariable === 'innerVariable'); // true
    return {
        innerFunction: function () {
            console.log(this.globalVariable === undefined); // true
            console.log(this.innerVariable === undefined); // true
        }
    }
}
 
globalFunction().innerFunction();

</script>
</html>